<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	StringBuffer errorString = new StringBuffer("");
	String tid = "0";
	String pagenum = "1";
	if (request.getParameter("tk") != null)
	{
		errorString.append("标题不能为空！\\n");
	}
	if (request.getParameter("ck") != null)
	{
		errorString.append("内容不能为空！ \\n");
	}
	if (request.getParameter("sl") != null)
	{
		errorString.append("图片应该小于3M！ \\n");
	}
	if (request.getParameter("f") != null)
	{
		errorString.append("上次图片格式不正确！\\n ");
	}
	if (request.getParameter("un") != null)
	{
		errorString.append("添加失败！ \\n");
	}
	if (request.getParameter("exs") != null)
	{
		errorString.append("已存在相同标题通告！\\n");
	}
	if (request.getParameter("tid") != null)
	{
		tid = request.getParameter("tid");
	}
	if (request.getParameter("pagenum") != null)
	{
		pagenum = request.getParameter("pagenum");
	}
	if (request.getParameter("ok") != null)
	{
		errorString.append("保存成功！\\n");
		tid = "0";//用来记录修改成功了
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>通告列表</title>
		<link href="css/gl/tglist.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="css/jquery/jquery-ui-1.8.14.custom.css" />
		<style type="text/css">
.ui-dialog-titlebar {
	display: none;
}
</style>
		<script type="text/javascript" src='dwr/engine.js'>
</script>
		<script type="text/javascript" src='dwr/util.js'>
</script>
		<script type="text/javascript" src="script/jquery/jquery-1.5.1.min.js">
</script>
		<script type="text/javascript"
			src="script/jquery/jquery-ui-1.8.14.custom.min.js">
</script>
		<script type="text/javascript"
			src="script/jquery/jquery.ui.datepicker-zh-CN.js">
</script>
		<script type="text/javascript" src='dwr/interface/NoticeDwr.js'>
</script>
		<script type="text/javascript"
			src="script/jquery/jquery.elastic.source.js">
</script>
		<script type="text/javascript" src="script/util.js">
</script>
		<script type="text/javascript" src="script/gl/tglist.js">
</script>
		<script type="text/javascript">
function error() {
currentPage=<%=pagenum%>;
			if("<%=errorString.toString()%>".length>0)
			{
				if(<%=tid%>!=0){
					Update(<%=tid%>);
				}
			 alert("<%=errorString.toString()%>");
			}
		}
</script>
	</head>

	<body>
		<div id="page_all">
			<jsp:include page="title.jsp" flush="true">
				<jsp:param name="jspName" value="tgModuleOpt" />
			</jsp:include>
			<div id="main">
				<div id="tgleft">
					<jsp:include page="tgleft.jsp" flush="true">
						<jsp:param name="jspName" value="tglistModuleOpt" />
					</jsp:include>
				</div>
				<div id="tgmain">
					<table id="searchbt" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								类别:
							</td>
							<td>
								<select id="kind" name="kind">
									<option value="0">
										请选择
									</option>
									<option value="1">
										国网
									</option>
									<option value="2">
										省网
									</option>
									<option value="3">
										市局
									</option>
								</select>
							</td>
							<td>
								&nbsp;类型:
							</td>
							<td>
								<select id="type" name="type">
									<option value="0">
										请选择
									</option>
									<option value="1">
										文字通告
									</option>
									<option value="2">
										图片通告
									</option>
								</select>
							</td>
							<td>
								&nbsp;日期:
							</td>
							<td>
								<input id="search_start" class="date" readonly="readonly"
									style="" type="text">
							</td>
							<td>
								至
							</td>
							<td>
								<input id="search_end" class="date" readonly="readonly" style=""
									type="text">
							</td>
							<td>
								<input id="tkey" style="" maxlength="100" type="text">
							</td>
							<td>
								<img alt="" src="img/gl/07.jpg" style="cursor: pointer;"
									onclick="Search()" />
							</td>
							<td>
								<img alt="" src="img/gl/08.jpg" style="cursor: pointer;"
									onclick="Reset()" />
							</td>
						</tr>
					</table>
					<table id="addnotice" cellpadding="0" cellspacing="0">
						<tr class="title">
							<td>
								序号
							</td>
							<td>
								标题
							</td>
							<td>
								类别
							</td>
							<td>
								上传时间
							</td>
							<td>
								图片新闻
							</td>
							<td>
								编辑
							</td>
						</tr>
						<tbody id="ttbody">

						</tbody>
						<tr class="title">
							<td colspan="6">
								<div id="deleteAll"
									style="width: 67px; height: 25px; float: right; padding-left: 1px; text-align: left;">
									<img alt="删除所选" src="img/gl/100.jpg" class="button"
										onclick="DelMore()" />
								</div>
								<div id="selectPanel"
									style="width: 100px; height: 18px; float: right; text-align: right; padding-right: 1px; margin-top: 2px;">
									全选
									<input id="checkedAll" type="checkbox">
								</div>
							</td>
						</tr>
					</table>

					<div id="pageinfo">
					</div>
					<div id="pager">
						<img id="fstPage" alt="首页" src="img/gl/13.jpg"
							class="button pager" style="margin-right: 5px;"
							onclick="ChangePage('fst')" />
						<img id="forePage" alt="上一页" src="img/gl/14.jpg"
							class="button pager" style="margin-right: 5px;"
							onclick="ChangePage('fore')" />
						<img id="nextPage" alt="下一页" src="img/gl/15.jpg"
							class="button pager" style="margin-right: 5px;"
							onclick="ChangePage('next')" />
						<div style="width: 100p;" class="pager" style="margin-right:5px;">
							转到
							<input id="gopage" style="width: 30px;" type="text" />
							页
						</div>
						<img alt="GO" src="img/gl/16.jpg" class="button pager"
							style="margin-right: 5px;" onclick="PageGo()" />
					</div>

				</div>
			</div>
			<div id="footer">
				<jsp:include page="footer.jsp" flush="true"></jsp:include>
			</div>
		</div>
		<div id="fullbg"></div>
		<div id="editpanel" class="opendiv">
			<form id="updateNotice" name="updateNotice" method="post"
				enctype="multipart/form-data" action="gl/addNotice.do">
				<div id="editbtm" class="opendivdom">
					<input id="img" name="img" type="hidden" value="0">
					<input id="tid" name="tid" type="hidden" value="0">
					<input id="pagenum" name="pagenum" type="hidden" value="0">
					<table id="editnotice" cellpadding="0" cellspacing="0">
						<tr>
							<td class="ftd">
								类&nbsp;别:
							</td>
							<td>
								<select id="kind1" name="kind">
									<option value="1">
										国网
									</option>
									<option value="2">
										省网
									</option>
									<option value="3">
										市局
									</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="ftd">
								标&nbsp;题:
							</td>
							<td>
								<input id="title" name="title" maxlength="100">
							</td>
						</tr>
						<tr>
							<td class="ftd" style="vertical-align: top;">
								内&nbsp;容:
							</td>
							<td>
								<textarea id="content" name="content"
									onkeyup="this.value = this.value.substring(0, 4999);"></textarea>
							</td>
						</tr>
						<tr>
							<td class="ftd">
								图&nbsp;片:
							</td>
							<td>
								<input id="imgfile" name="imgfile" type="file"
									style="height: 21px;">
							</td>
						</tr>
						<tr>
							<td class="ftd">
							</td>
							<td>
								<input type="checkbox" id="hasimg" name="hasimg">
								图片通告
							</td>
						</tr>
						<tr>
							<td colspan="2" style="text-align: center;">
								<img alt="" style="cursor: pointer;" src="img/gl/17.jpg"
									onclick="UpToGao()" />
								<img alt="" style="cursor: pointer; margin-left: 50px;"
									src="img/gl/18.jpg" onclick="CancelUp()" />
							</td>
						</tr>
					</table>
				</div>
			</form>
		</div>
		<div id="showpanel" class="opendiv">
			<div id="showdiv" class="opendivdom" style="text-align: center;">
				<div style="height: 18px;"></div>
				<div id="stitle"></div>
				<div style="height: 10px;"></div>
				<img id="simg" src=""/>
				<div style="height: 10px;"></div>
				<div id="scontest">
					<textarea id="textcontest" readonly="readonly"
						style="border: solid 0px red; width: 86%; height: 20px; background-color: transparent; overflow: visible;line-height: 25px;font-size:13px;">
	                </textarea>
				</div>
				<div style="height: 20px;"></div>
				<div id="closeshow">
					<img alt="" src="img/gl/18.jpg" class="button"
						onclick="closeShow()" />
				</div>
				<div style="height: 30px;"></div>
			</div>
		</div>
	</body>
</html>
